package org.duang.common.exceptios;

import org.duang.common.enums.IEnums;

/**
 * Proxy层公用的Exception.
 * 
 */
public class ProxyException extends RuntimeException {

	private static final long serialVersionUID = -3002770116100299451L;
	private int code = IEnums.IENUMS_FAIL_CODE;
	private String message = IEnums.IENUMS_FAIL_MESSAGE;
	private IEnums enums;

	public ProxyException() {
		super();
	}

	public ProxyException(String message) {
		super(message);
	}

	public ProxyException(Throwable cause) {
		super(cause);
	}

	public ProxyException(String message, Throwable cause) {
		super(message, cause);
	}

	public ProxyException setCode(int code) {
		this.code = code;
		return this;
	}

	public ProxyException setMessage(String message) {
		this.message = message;
		return this;
	}

	public ProxyException setIEnums(IEnums enums) {
		this.enums = enums;
		return this;
	}

	public ProxyException(IEnums enums) {
		// super(enums.getMessage());
		this.message = enums.getMessage();
		this.enums = enums;
	}

	public int getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

	public IEnums getEnums() {
		return enums;
	}
}
